package com.springBoot.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.github.pagehelper.PageInfo;
import com.springBoot.DataSource01.service.UserService01;
import com.springBoot.DataSource02.service.UserService02;
import com.springBoot.pojo.User;

@RestController
public class UserController {

	@Autowired
	@Qualifier("userServiceImpl01")
	private UserService01 userService01;

	@Autowired
	@Qualifier("userServiceImpl02")
	private UserService02 userService02;

	@RequestMapping("/addUser1")
	public Integer addUser1(String loginName, int i) {
		Integer result = userService01.addUser(loginName, i);
		return result;
	}

	@RequestMapping("/addUser2")
	public Integer addUser2(String loginName) {
		Integer result = userService02.addUser2(loginName);
		return result;
	}

	@RequestMapping("/getUserList")
	public PageInfo<User> getUserList(int page, int pageSize) {
		return userService01.getUserList(page, pageSize);

	}
}
